home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_sol_bluegem.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
11KB
|
412 lines
# Jones 3D Cog Script
#
# SOL_BlueGem.cog
#
# [TRM]
#
# Blue = GemB bin 96
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
# ========================================================================================
symbols
message startup
message user0
message activated
message touched
message arrived
message sighted
message damaged
message pulse
thing player local
thing deadIndy local
thing gem_Item local
thing gem2 local
thing torch0
thing torch1
thing flame0
thing flame1
thing gem mask=0x408
thing t_WhipMe mask=0x408
thing trapDoor
thing spikes
thing interpCam
surface surf0
surface surf1
surface surf2
surface surf_Gem1 mask=0x408
surface surf_Gem2 mask=0x408
surface surf_Gem3 mask=0x408
sector lookAtMe
sector sec_trapTrig
sound burning=gen_torch_burnin_c.wav local
sound lite=gen_torchlitet_c.wav local
sound sndDie=tem_temspikes_up_kill_c.wav local
sound say_whistle=Inxj006.wav local # whistle
sound say_NowWhat=Inxj012.wav local # Now what!
sound say_Ugh=inxj018a.wav local
sound sfx_Trap1=pru_trapblock_stuck_c.wav local
sound sfx_Trap2=tem_temspikes_activate_c.wav local
sound snd_Gem1=Inxj193.wav local # First gem: One of King Sol's jewels.
sound snd_Gem2=Inxj194.wav local # Second gem: Another Jewel...
sound snd_Gem3=Inxj195.wav local # Third gem: A third gem...
template tpl_Indy=indy_sh_actor local
template tpl_Item=gemb local # blue gem item
template tpl_Gem=gembmove local # blue gem move
keyframe inDie=in_die_buckle.key local
cog redGem
cog greenGem
cog hintCog
cog talkCog local
flex flickertime=2.0
flex lituptime=0.5
flex maxradius=0.15
flex minradius=0.15
vector minlite local
vector maxlite local
vector zerolite local
vector posOffset local
vector angOffset local
vector dir local
int lit=0 local
int vibe local
int curFrame local
int once=1 local
int gemsFound=0 local
int deadMan=0 local
int victim local
int whipped=0 local
int dif_Level local
# ** subroutines **
flex pickupGem local
end
# ========================================================================================
code
startup:
player = GetLocalPlayerThing();
minlite = VectorSet(0.87, 0.55, 0.06);
maxlite = VectorSet(0.89, 0.64, 0.30);
zerolite = VectorSet(0.25, 0.25, 0.0);
SetThingFlags(flame0, 0x10);
SetThingFlags(flame1, 0x10);
SetThingLight(torch0, zerolite, maxradius, 0.1);
SetThingLight(torch1, zerolite, maxradius, 0.1);
SetThingLight(trapDoor, '0.50 0.50 0.25', 0.001, 0.1);
SetThingLight(spikes, '0.50 0.50 0.25', 0.001, 0.1);
SetThingLight(gem, '0.3 0.3 0.8', 0.001, 0.1);
return;
# ========================================================================================
user0:
gemsFound = gemsFound + 1;
return;
# ========================================================================================
activated:
if(lit == 1) return;
if((GetSenderRef() == t_WhipMe) && (whipped == 0))
{
lit = 1;
Call pickupGem;
}
else if((GetSenderRef() == gem) || (GetSenderRef() == gem2))
{
Print("picking up gem");
lit = 1;
Call pickupGem;
}
return;
# ========================================================================================
pickupGem:
# increase gemsfound in the other cogs
SendMessage(redGem, user0);
SendMessage(greenGem, user0);
# solve hint21
SendMessage(hintCog, user0);
dif_Level = GetDifficulty();
# do cutscene stuff
MakeMeStop();
# offset camera
if(whipped == 0) SetExtCamOffsetToThing(interpCam);
# put away any weapon
DeselectWeaponWait(player);
# pick up the gem
if(whipped == 0) PlayMode(player, 60, 0);
else PlayMode(player, 24, 0);
# Call the Pickup Lines cog
talkCog = GetCogByIndex(0);
SendMessage(talkCog, 27);
# rest and then destroy gem
Sleep(0.3);
if(whipped == 0) DestroyThing(gem);
else DestroyThing(gem2);
# add gemb to inventory
SetInvAvailable(player, 96, 1);
ChangeInv(player, 96, 1.0);
JonesInvItemChanged(96);
# sleep for a bit to wait for talkCog
Sleep(1.0);
# play dialog as gems spins into inventory
if(gemsFound == 0)
{
PlayVoice(player, snd_Gem1, 1.0, 1);
}
else if(gemsFound == 1)
{
PlayVoice(player, snd_Gem2, 1.0, 1);
}
else if(gemsFound == 2)
{
PlayVoice(player, snd_Gem3, 1.0, 1);
}
# increase gemsfound in this cog
gemsFound = gemsFound + 1;
# return control to player
ClearActorFlags(player, 0x200000);
RestoreExtCam();
Sleep(0.25);
# shake the place
SetPulse(0.01);
# light the torches
ClearThingFlags(flame0, 0x10);
ClearThingFlags(flame1, 0x10);
PlaySoundThing(lite, torch0, 1.0, 5, 15, 0x0);
PlaySoundThing(lite, torch1, 1.0, 5, 15, 0x0);
SetThingLight(torch0, minlite, maxradius, lituptime);
SetThingLight(torch1, minlite, maxradius, lituptime);
PlaySoundThing(burning, torch0, 1.0, 5, 15, 0x1);
PlaySoundThing(burning, torch1, 1.0, 5, 15, 0x1);
Sleep(0.5);
# move door down slightly to alert player
SetAdjoinFlags(surf0, 2); # move
SetAdjoinFlags(surf1, 2);
DetachThing(player);
MoveToFrame(trapDoor, 1, 2.0);
PlaySoundLocal(sfx_Trap1, 1.0, 0.0, 0x0, 0);
Sleep(0.01);
ClearAdjoinFlags(surf2, 2); # no move
# say "now what!"
if(whipped == 0) PlayVoice(player, say_NowWhat, 1.0, 1);
curFrame = 1;
SetPulse(0.0);
if(whipped == 0)
{
if(dif_Level < 3)
{
Sleep(2.5);
}
else if(dif_Level == 3)
{
Sleep(1.0);
}
}
Sleep(0.5);
# lower trap door all the way
SetAdjoinFlags(surf2, 2); # move
DetachThing(player);
MoveToFrame(trapDoor, 2, 8.0);
PlaySoundLocal(sfx_Trap2, 1.0, 0.0, 0x0, 0);
return;
# ========================================================================================
touched:
if((GetSenderRef() == spikes) && (deadMan == 0) && (GetThingHealth(player) > 0))
{
Print("I'm squishing your head");
deadMan = 1;
SetCollideType(spikes, 0);
DamageThing(player, 1000.0, 0x1, victim);
Sleep(0.1);
PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
PlaySoundLocal(say_Ugh, 1.0, 0.0, 0x0, 0);
# hide player
SetThingFlags(player, 0x80000);
# create actor indy
deadIndy = CreateThing(tpl_Indy, player);
CaptureThing(deadIndy);
# Show actor Indy and play Keyframe
ClearThingFlags(deadIndy, 0x80000);
PlayKey(deadIndy, inDie, 4, 0x14, 0);
}
return;
# ========================================================================================
arrived:
if(curFrame == 1)
{
Print("arrived");
SetThingLight(trapDoor, '0.0 0.0 0.0', 0.0, 0.01);
curFrame = 2;
UpdateDifficulty(dif_Level);
Sleep(2.0);
# if he's still alive, prepare sector for whistle
if(GetThingHealth(player) > 0)
{
ClearSectorFlags(lookAtMe, 0x4000);
once = 0;
}
}
return;
# ========================================================================================
sighted:
if((GetSenderRef() == lookAtMe) && (once == 0) && (deadMan == 0))
{
once = 1;
PlayVoice(player, say_Whistle, 1.0, 1);
}
return;
# ========================================================================================
damaged:
Print("damaged");
if((GetParam(1) != 0x10) || (whipped == 1)) return;
whipped = 1;
# create item gem for whipping
gem_Item = CreateThing(tpl_Item, gem);
CaptureThing(gem_Item);
DestroyThing(gem);
gem = -1;
dir = VectorAdd(GetThingPos(player), '0.0 0.0 0.3');
dir = VectorScale(VectorSub(dir, GetThingPos(gem_Item)), 0.13);
ApplyForce(gem_Item, dir);
Sleep(1.0);
# create a move gem
gem2 = CreateThing(tpl_Gem, gem_Item);
CaptureThing(gem2);
DestroyThing(gem_Item);
Print("hi");
return;
# ========================================================================================
pulse:
# shake the camera
vibe = RandBetween(1, 4);
if (vibe == 1)
{
posOffset = '-0.005 0.00 -0.002';
angOffset = '0.00 -0.002 0.002';
}
if (vibe == 2)
{
posOffset = '0.005 -0.005 0.002';
angOffset = '0.002 0.00 -0.002';
}
if (vibe == 3)
{
posOffset = '0.002 0.005 -0.005';
angOffset = '-0.002 0.002 -0.002';
}
if (vibe == 4)
{
posOffset = '-0.002 0.00 0.005';
angOffset = '0.00 0.00 0.002';
}
SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
return;
# ========================================================================================
end